package pc.sort;

public class Insertion extends AbstractSort {

	@Override
	public void execute(int[] in) {
		int tmp;
		int j;
		for ( int i = 1; i < in.length; ++i ) {
			tmp = in[i];
			j = i-1;
			while( j >= 0 && in[j] > tmp ) {
				in[j+1] = in[j];
				--j;
			}
			in[j+1] = tmp;
		}
	}

}
